name: Build docs

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9

      - name: Install dependencies
        run: |
          python -m pip install nox mkdocs-material

      - name: Generate API Documentation
        run: |
          python -m nox -s docs
      - name: Deploy docs
        run: |
          mkdocs gh-deploy --force
